package com.songyz.image.compress.dto;

import com.songyz.image.compress.enums.Compress;

public class ImageCompressDTO {

    private String fileName;// 文件名称
    private int status;// 压缩状态
    private String statusName;// 压缩状态

    private long fileSize;// 压缩前大小
    private long compressSize;// 压缩后大小
    private String widthAndHeight;// 压缩前宽高
    private String compressWidthAndHeight;// 压缩后宽高

    private double compressRate;// 压缩率

    public ImageCompressDTO() {
    }

    public ImageCompressDTO(String fileName, Compress status) {
        this.fileName = fileName;

        this.status = status.getCode();
        this.statusName = status.getName();
    }

    public void setStatus(Compress status) {
        this.status = status.getCode();
        this.statusName = status.getName();
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getStatusName() {
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public long getFileSize() {
        return fileSize;
    }

    public void setFileSize(long fileSize, long compressSize) {
        this.fileSize = fileSize;
        this.compressSize = compressSize;
        this.compressRate = (compressSize + 0.0) / fileSize;
    }

    public long getCompressSize() {
        return compressSize;
    }

    public String getWidthAndHeight() {
        return widthAndHeight;
    }

    public void setWidthAndHeight(String widthAndHeight) {
        this.widthAndHeight = widthAndHeight;
    }

    public String getCompressWidthAndHeight() {
        return compressWidthAndHeight;
    }

    public void setCompressWidthAndHeight(String compressWidthAndHeight) {
        this.compressWidthAndHeight = compressWidthAndHeight;
    }

    public double getCompressRate() {
        return compressRate;
    }

}
